package com.vecspace.msoffice;

/**
 * 
 * @version: 1.0
 * @author: wanghua
 */
public class CellValue {
	private boolean isMergedCell = false;
	private boolean isMergeReginFirsetCell = false;
	private int rowSpan;
	private int colSpan;
	private Object value;
	private CellDataType dataType;
	private int rownum, colnum;
	public CellValue(int rownum, int colnum) {
		this.rownum = rownum;
		this.colnum = colnum;
	}
	
	public boolean isMergedCell() {
		return isMergedCell;
	}
	public void setMergedCell(boolean isMergedCell) {
		this.isMergedCell = isMergedCell;
	}
	public Object getValue() {
		return value;
	}
	public void setValue(Object value) {
		this.value = value;
	}
	
	/**
	 * 强制获取单元格的字符串值（如果是其他类型的，使用toString转为字符串）
	 * @return 
	 * @author: wanghua
	 */
	public String getStringValue() {
		if(value == null)return null;
		return value.toString();
	}
	
	/**这个单元格是否属于合并单元格
	 * 
	 * @return 
	 * @author: wanghua
	 */
	public boolean isMergeReginFirsetCell() {
		return isMergeReginFirsetCell;
	}
	
	/**这个单元格是否属于合并单元格的左上角第一个单元格
	 * 
	 * @param isMergeReginFirsetCell 
	 * @author: wanghua
	 */
	public void setMergeReginFirsetCell(boolean isMergeReginFirsetCell) {
		this.isMergeReginFirsetCell = isMergeReginFirsetCell;
	}

	public int getRownum() {
		return rownum;
	}

	public void setRownum(int rownum) {
		this.rownum = rownum;
	}

	public int getColnum() {
		return colnum;
	}

	public void setColnum(int colnum) {
		this.colnum = colnum;
	}

	public CellDataType getDataType() {
		return dataType;
	}

	public void setDataType(CellDataType dataType) {
		this.dataType = dataType;
	}

	public int getRowSpan() {
		return rowSpan;
	}

	public void setRowSpan(int rowSpan) {
		this.rowSpan = rowSpan;
	}

	public int getColSpan() {
		return colSpan;
	}

	public void setColSpan(int colSpan) {
		this.colSpan = colSpan;
	}
}
